#pragma once
#include "ISingleton.h"

#include <d3d9.h>
#include <d3dx9.h>

namespace D3Ds
{
	class D3D :	public Core::Pattern::ISingleton<D3D>
	{
	private:
		LPDIRECT3D9 m_pD3D;	
	public:
		D3D(void);
		LPDIRECT3D9 GetD3D(void);
		~D3D(void);
	};

	#define D3DFVF_RTG_VERTEX (D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1)
	#define VERTEX_BUFFER_SIZE 4000
	struct RTG_VECTOR3
	{
		float x,y,z;
		RTG_VECTOR3();
		RTG_VECTOR3(float& _x,float& _y,float& _z);
	};
	struct RTG_VECTOR2
	{
		float x,y;
		RTG_VECTOR2();
		RTG_VECTOR2(float& _x,float& _y);
	};
	struct RTG_VERTEX
	{
			float			x, y;		// screen position    
			float			z;			// Z-buffer depth 0..1
			//float			rhw;		// rhw value
			DWORD			diffuse;	// diffuse color
			float			tx, ty;		// texture coordinates
			RTG_VERTEX();
	};
}